package com.tju.welding.dao;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

@Mapper
@Component
public interface TestMapper {

    @Select("SELECT COUNT(*) AS custNum FROM test")
    int getCustNum();

    @Select("SELECT image_location FROM test WHERE data = #{data}")
    String getImagePath(@Param("data") int data);

    @Insert("INSERT INTO test (`data`, `image_location`) VALUES(#{data}, #{image_location})")
    int addRecord(@Param("data") int data, @Param("image_location") String image_location);
    
}
